Atmospheric Effects by Mikael Segercrantz
Version 6.2
A table-based way to add atmospheric effects to rooms, regions, things and scenes.
Chapter 1: Version Note
Section 1.1: 6L02 Compatibility Update
Chapter 2: The Kinds Provided
Section 2.1: The Sceninc Types
Section 2.2: The Running Types
Section 2.3: The Further Types
Section 2.4: The Ignoring Types
Section 2.5: How Types Interact
Chapter 3: The Tables Required
Section 3.1: The Table of Atmospheric Definition
Section 3.2: The Sub-Tables of the Table of Atmospheric Definition
Section 3.3: The Sub-Tables of the Sub-Tables of the Table of Atmospheric Definition
Section 3.4: The Table of Messages to Show
Chapter 4: The Tables Defined
Chapter 5: Overriding
Section 5.1: How to Override this Extension's Default Behavior
Section 5.2: How the Scenic Messaging Rule is Defined
Section 5.3: How the Scenic Displaying Rule is Defined
Chapter 6: Internals
Examples
A — Forest and Clearing
B — City and Neighborhood
C — The City-Plane of Union
Chapter 1: Version Note
This version of the extension breaks compatibility with any previous version earlier than version 4. It is highly recommended to upgrade all code using any previous version of Atmospheric Effects to use this version.
Version 4 of Atmospheric Effects was a complete rewrite, containing almost all the features available in previous releases. This version is improved to work better, and to separate the displaying of scenic messages from the generation of them in a greater degree. (In the last version, where the messages were generated just before the prompt, the scene changing mechanism had run between the result of the action and the generation of messages; now, the messages are generated just after getting the result of the action, and the messages are displayed only just before prompting for the next command, which seems to fix the problem of messages dependent on scenes.)
Section 1.1: 6L02 Compatibility Update
This extension differs from the author's original version: it has been modified for compatibility with version 6L02 of Inform. The latest version of this extension can be found at <https://github.com/i7/extensions>.
This extension is released under the Creative Commons Attribution licence. Bug reports, feature requests or questions should be made at <https://github.com/i7/extensions/issues>.
Chapter 2: The Kinds Provided
This extension provides four kinds of value; a scenic type, a running type, a further type and an ignoring type.
Section 2.1: The Sceninc Types
The scenic types are
* fully random (with full random as a synonym), displaying messages in a completely random order, without regard to if the message has been shown or not;
* random, displaying messages in a constrained random order, so that each message in the table is shown once before any message may repeat; and
* ordered, listing the messages in the same order they are defined in the table.
Section 2.2: The Running Types
The running types are
* run once (with once as a synonym), the messages of the table will show up only once; and
* run forever (with forever as a synonym), the messages will loop once the table has been used, and if the scenic type is random, again in a random order (making sure the same message does not appear twice in a row).
Section 2.3: The Further Types
The further types are
* default, which changes to the Table of Default Messages once all the messages in the current table have been exhausted; and
* stopping, which stops the current table once it has been exhausted and doesn't bring in a new source of messages.
Section 2.4: The Ignoring Types
The ignoring types are
* ignore, which
1) In the Atmospheric Definition table on things tells the extension to ignore rooms and regions (note that at the moment this means that even if the thing has ran out of messages, it forces the room and regions to be quiet whenever it is present);
2) In the Atmospheric Definition table on rooms tells the extension to ignore regions;
3) In the Atmospheric Definition table on regions tells the extension to ignore larger regions; and
4) In the subtables of the Atmospheric Definition table tells the extension to ignore all lines after the current line in case a message was shown.
and
* do not ignore, which is the opposite of ignore.
Section 2.5: How Types Interact
For entries with a scenic type of fully random, the running type and the further type are completely ignored, and for entries with a running type of run forever, the further type is completely ignored.
Chapter 3: The Tables Required
Section 3.1: The Table of Atmospheric Definition
To use scenic effects in our games, we need to define the following table:
Table of Atmospheric Definition (continued)
loci ignoring subtable an object an ignoring type a table-name
The loci entry contains the name of the room or region for which to use the subtable entry for messages, while the ignoring type tells the extension whether to ignore messages from larger entities containing the player.
Section 3.2: The Sub-Tables of the Table of Atmospheric Definition
In addition, for each separate subtable required, we need to define a table following the form of:
Table of Example Atmospheric Definition
during initch latch aftcnt curcnt sctype runtype frtype igtype subtable a scene a number a number a number a number a scenic type a running type a further type an ignoring type a table-name
Where the during entry is the name of the scene during which the messages from the subtable will be displayed (or empty for any time), initch is the initial chance of displaying messasges, latch is the later chance for displaying messages, aftcnt is the number of messages to show before changing from the initial chance to the later chance, curcnt is the current amount of messages shown, sctype is the scenic type of the messages to be shown, runtype the running type, frtype the further type, igtype the ignoring type and finally subtable contains the name of the table from which the messages will be picked.
If any of these entries except the during entry and the subtable entry are missing, they will be initialized automatically. The initial chance to 100 percent, the later chance to the initial chance, the after count to 0, the scenic type to random, the running type to run forever, the further type to stopping and the ignoring type to do not ignore. If the subtable is the Table of Default Messages, the running type is automatically set to run forever and the further type to stopping. The current count is always initialized to 0. If there is no subtable entry, the whole row is ignored.
Section 3.3: The Sub-Tables of the Sub-Tables of the Table of Atmospheric Definition
For each separate table of messages required, we also need to define a table according to the following specification:
Table of Example Messages
used message a number text
Section 3.4: The Table of Messages to Show
In addition, we may need to continue the Table of Messages to Show, in case there may be more than 20 messages to show at one time. This is done as follows:
Table of Messages to Show (continued)
message with <number> blank rows
Chapter 4: The Tables Defined
This extension provides a few tables of its own, each one empty except for one blank row to contrain the contents of the table. We have already encountered one of these, the Table of Atmospheric Definition, which is used to initialize the locations and regions of the game world with the correct scenic messasges.
The second one is the Table of Default Atmospherics. If we fill this table up with information, the messages of any subtables of it will be shown in any room or region not mentioned in the Table of Atmospheric Definition.
We are also provided with the Table of Default Messages, which can be filled with messages to be used when the further type of some messasge source is default and all the messages in the original table of messages have been shown.
Also, the extension brings us the Table of Messages to Show, which is used to collect the messages to be displayed during one turn. The default size of the table is 20 rows, which may be increased if necessary.
Chapter 5: Overriding
Section 5.1: How to Override this Extension's Default Behavior
If necessary, it is possible to override two of the rules provided by this extension. The first, called "the scenic messaging rule", allows for the modification of the message-generating process. The second, called "the scenic displaying rule", allows for the modification of the message-displaying process. If we wish to override one or both of these rules, it is possible with a procedural rule such as the following one:
Procedural rule:
substitute own messaging rule for the scenic messaging rule;
substitute own displaying rule for the scenic displaying rule.
Section 5.2: How the Scenic Messaging Rule is Defined
The scenic messaging rule provided by the extension is defined as follows:
A first every turn rule (this is the scenic messaging rule):
correct synonyms;
check thing messages;
check room messages;
check region messages.
Section 5.3: How the Scenic Displaying Rule is Defined
The scenic displaying rule provided by the extension is defined as follows:
A last before reading a command rule (this is the scenic displaying rule):
display all messages.
This rule has been defined as a before reading a command rule, so that the first messages will be shown before reading the first command in the game.
Chapter 6: Internals
The extension defines a kind of value called shown type used on regions. It is highly recommended that it not be used by anyone.
The extension also defines a region called the empty region. It is used by the extension to manage looking through regions.
|
Example Forest and Clearing A simple example of regional and room effects, and ignoring messages. |
|
Example City and Neighborhood A more complex example on using Atmospheric Effects on rooms and regions, with regions contained in other regions. |
|
Example The City-Plane of Union Showing how to use the Atmospheric Effects extension using as a setting the City-Plane of Union from the Epic Level Handbook for the latest edition of AD&D. |
"The City-Plane of Union" Include Version 6 of Atmospheric Effects by Mikael Segercrantz. Use full-length room descriptions and the serial comma. Part 1 - Geography Chapter 1 (a) - Planar Gate Planar Gate is a room. Planar Gate Region is a region. The planar gate is in the planar gate region. Chapter 1 (b) - Temple Quarter Northwest Temple Quarter is a room. South of northwest temple quarter is a room called Southwest Temple Quarter. East of southwest temple quarter is a room called East Temple Quarter. It is southeast of northwest temple quarter. Temple Quarter Region is a region. Northwest temple quarter, southwest temple quarter and east temple quarter are in the temple quarter region. Chapter 1 (c) - Material Gate Material Gate is a room. Material Gate Region is a region. The material gate is in the material gate region. Chapter 1 (d) - Military Quarter South Military Quarter is a room. North of south military quarter is a room called North Military Quarter. Military Quarter Region is a region. North military quarter and south military quarter are in the military quarter region. Chapter 1 (e) - High Quarter Southeast High Quarter is a room. Northwest of southeast high quarter is a room called Northwest High Quarter. High Quarter Region is a region. Southeast high quarter and northwest high quarter are in the high quarter region. Chapter 1 (f) - Commerce Quarter Northwest Commerce Quarter is a room. South of northwest commerce quarter is a room called Southwest Commerce Quarter. East of northwest commerce quarter is a room called Northeast Commerce Quarter. It is northeast of southwest commerce quarter. South of northeast commerce quarter is a room called Southeast Commerce Quarter. It is east of southwest commerce quarter and southeast of northwest commerce quarter. Commerce Quarter Region is a region. Northwest commerce quarter, southwest commerce quarter, northeast commerce quarter and southeast commerce quarter are in the commerce quarter region. Chapter 1 (g) - Market Quarter Northwest Market Quarter is a room. South of northwest market quarter is a room called Southwest Market Quarter. East of southwest market quarter is a room called South Market Quarter. It is southeast of northwest market quarter. North of south market quarter is a room called North Market Quarter. It is northeast of southwest market quarter and east of northwest market quarter. East of north market quarter is a room called Northeast Market Quarter. It is northeast of south market quarter. South of northeast market quarter is a room called Central Southeast Market Quarter. It is southeast of north market quarter and east of south market quarter. East of central southeast market quarter is a room called Southeast Market Quarter. It is southeast of northeast market quarter. Market Quarter Region is a region. Northwest market quarter, southwest market quarter, north market quarter, south market quarter, northeast market quarter, central southeast market quarter and southeast market quarter are in the market quarter region. Chapter 1 (h) - Magic Quarter West Magic Quarter is a room. East of west magic quarter is a room called East Magic Quarter. Magic Quarter Region is a region. West magic quarter and east magic quarter are in the magic quarter region. Chapter 1 (i) - Perfumed Quarter Southwest Perfumed Quarter is a room. East of southwest perfumed quarter is a room called Southeast Perfumed Quarter. North of southwest perfumed quarter is a room called North Perfumed Quarter. It is northwest of southeast perfumed quarter. Perfumed Quarter Region is a region. Southwest perfumed quarter, southeast perfumed quarter and north perfumed quarter are in the perfumed quarter region. Chapter 1 (j) - Tavern Quarter East Tavern Quarter is a room. West of east tavern quarter is a room called West Tavern Quarter. Tavern Quarter Region is a region. East tavern quarter and west tavern quarter are in the tavern quarter region. Chapter 1 (k) - Guild Quarter Southeast Guild Quarter is a room. Northwest of southeast guild quarter is a room called Northwest Guild Quarter. Guild Quarter Region is a region. Southeast guild quarter and northwest guild quarter are in the guild quarter region. Chapter 1 (l) - Staircase Gate Staircase Gate is a room. Staircase Gate region is a region. Staircase gate is in the staircase gate region. Chapter 1 (m) - Bridges Planar-Temple Bridge is a room. It is south of planar gate and north of northwest temple quarter. Planar-Material Bridge is a room. It is north of planar gate and south of material gate. Planar-Commerce Bridge is a room. It is northeast of planar gate and southwest of southwest commerce quarter. Temple-Market Bridge is a room. It is northeast of east temple quarter and southwest of southwest market quarter. Material-Military Bridge is a room. It is north of material gate and south of south military quarter. Material-Commerce Bridge is a room. It is east of material gate and west of southwest commerce quarter. Military-High Bridge is a room. It is northwest of north military quarter and southeast of southeast high quarter. Military-Commerce Bridge is a room. It is southeast of south military quarter and northwest of northwest commerce quarter. Commerce-Market Bridge is a room. It is south of southeast commerce quarter and north of northwest market quarter. Market-Magic Bridge is a room. It is north of northeast market quarter and south of west magic quarter. Commerce-Magic Bridge is a room. It is southeast of northeast commerce quarter and northwest of west magic quarter. Magic-Perfumed Bridge is a room. It is northeast of east magic quarter and southwest of southwest perfumed quarter. Magic-Staircase Bridge is a room. It is north of east magic quarter and south of staircase gate. Commerce-Guild Bridge is a room. It is north of northeast commerce quarter and south of southeast guild quarter. Guild-Tavern Bridge is a room. It is northeast of southeast guild quarter and southwest of west tavern quarter. Tavern-Staircase Bridge is a room. It is southeast of west tavern quarter and northwest of staircase gate. Tavern-Perfumed-Staircase Bridge is a room. It is east of east tavern quarter, north of staircase gate and west of north perfumed quarter. Chapter 1 (n) - The City-Plane City-Plane of Union is a region. Planar-temple bridge, planar-commerce bridge, planar-material bridge, temple-market bridge, material-military bridge, material-commerce bridge, military-high bridge, military-commerce bridge, commerce-market bridge, market-magic bridge, commerce-magic bridge, magic-perfumed bridge, magic-staircase bridge, commerce-guild bridge, guild-tavern bridge, tavern-staircase bridge, tavern-perfumed-staircase bridge, planar gate region, material gate region, military quarter region, high quarter region, temple quarter region, commerce quarter region, market quarter region, magic quarter region, perfumed quarter region, tavern quarter region, guild quarter region and staircase gate region are in the city-plane of union. Chapter 1 (o) - Objects A gushing fountain is in southwest commerce quarter. It is fixed in place. Part 2 - Atmospherics Chapter 2 (a) - Full City-Plane Table of City-Plane of Union Definition Table of Arrival Messages Table of Encounter Messages Chapter 2 (b) - Specific things Table of Gushing Fountain Definition Table of Gushing Fountain Messages Chapter 2 (c) - The Stairway Gate Table of Stairway Gate Definition Table of Stairway Gate Messages Chapter 2 (d) - Definition Table of Atmospheric Definition (continued) Part 3 - Scenes Chapter 3 (a) - Arrival Arrival is a scene. Arrival begins when play begins. Arrival ends when the number of filled rows in the Table of Arrival Messages is 0. Chapter 3 (b) - Encounters Encounters is a scene. Encounters begins when Arrival ends. Part 4 - Modifications Chapter 4 (a) - Room The description of a room is usually "[exit list]". To say exit list: To say optional comma: Chapter 4 (b) - Status line When play begins: Part 5 - Starting and ending the game Chapter 5 (a) - Starting When play begins: Chapter 5 (b) - Ending Every turn: |